<?php
namespace yan\hkecship\test;
use Yii;
class ApiTest{
	public static function test(){
		return self::testCountryList();
	}
	public static function testCountryList(){
		$data = \yan\hkecship\EcShipService::instance()->build([
			'business' => Yii::$app->params['hkpost']['business'],
			'token' => Yii::$app->params['hkpost']['token'],
		])->run(null, 'countryList');
		// file_put_contents('countrylist.json', json_encode($data));
		var_dump($data);
	}

	public static function testPostage(){
		$data = \yan\hkecship\EcShipService::instance()->build([
			'business' => Yii::$app->params['hkpost']['business'],
			'token' => Yii::$app->params['hkpost']['token'],
		])->run([
			'countryCode' => 'ARA',
			'shipCode' => 'SPL',
			'weight' => '30',
			'sizeDim1' => '150',
			'sizeDim2' => '90',
			'sizeDim3' => '60',
			'currCode' => 'HKD',
			'productValue' => '100',
		], 'postage');
		var_dump($data);
	}
}